import React, { Component } from 'react'
import PropTypes from 'prop-types';
import Item from '../item'
export default class list extends Component {
  static propTypes={
    updateTodo:PropTypes.func.isRequired,
    deleteTodo:PropTypes.func.isRequired
  }
  render() {
    const { todoList, updateTodo,deleteTodo } = this.props
    return (
      <div>
        {
          todoList.map(e => {
            return <Item key={e.id} {...e} updateTodo={updateTodo} deleteTodo={deleteTodo}/>
          })
        }

      </div>
    )
  }
}
